home *** CD-ROM | disk | FTP | other *** search
- package symantec.itools.db.net;
-
- import java.io.DataInputStream;
- import java.io.DataOutputStream;
- import java.io.IOException;
- import symjava.sql.SQLException;
-
- class Char extends CharField {
- int getType() {
- return 69;
- }
-
- void write(DataOutputStream out) throws IOException {
- super.write(out);
- NetString s = new NetString(super._data);
- s.write(out);
- EOT eot = new EOT();
- eot.write(out);
- }
-
- void read(DataInputStream in) throws SQLException, IOException, ErrorException {
- super.read(in);
- if (!super._null) {
- ServerObject obj = (ServerObject)NetClass.getNextObject(in);
- if (obj.getType() == 52) {
- super._data = ((NetString)obj).toString();
- } else {
- ((ServerObject)this).onObjectError(obj);
- }
- }
-
- ServerObject obj = (ServerObject)NetClass.getNextObject(in);
- if (obj.getType() != 50) {
- ((ServerObject)this).onObjectError(obj);
- }
-
- }
-
- public int getSQLType() {
- return 1;
- }
-
- public Object getObject() throws SQLException {
- return ((CharField)this).getString();
- }
-
- public void setObject(Object obj) throws SQLException {
- ((CharField)this).setString((String)obj);
- }
- }
-